﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Manon.Core.Extensions
{
    /// <summary>
    /// 随机数生成
    /// </summary>
    public interface IRandomCode
    {
        /// <summary>
        /// 异步随机生成指定位数随机数  默认4位
        /// </summary>
        /// <param name="codeLength"></param>
        /// <returns></returns>
        Task<string> GenerateOnlyNumberAsync(int codeLength = 4);

        /// <summary>
        /// 异步随机生成指定位数编码 默认4位
        /// </summary>
        /// <param name="codeLength"></param>
        /// <returns></returns>
        Task<string> GenerateCodeAsync(int codeLength = 4);

        /// <summary>
        /// 随机生成指定位数随机数  默认4位
        /// </summary>
        /// <param name="codeLength"></param>
        /// <returns></returns>
        string GenerateOnlyNumber(int codeLength = 4);

        /// <summary>
        /// 随机生成指定位数编码 默认4位
        /// </summary>
        /// <param name="codeLength"></param>
        /// <returns></returns>
        string GenerateCode(int codeLength = 4);
    }
}
